<?php
namespace app\index\controller;

use think\Db;

class Tags extends Base
{
    public function index()
    {
        $tags = input('tags');
        $map['a.keywords'] = ['like', '%' . $tags . '%'];
        $taglst = db('article')->alias('a')->join('ym_cate c', 'c.id=a.cateid', 'LEFT')
            ->field('a.id,a.title,a.pic,a.time,a.desc,a.click,a.keywords,c.catename')->order('a.id')->where($map)->paginate(2);
        $this->assign('tagslst', $taglst);
        return $this->fetch('lst');
    }
}
